package com.gpsnav.file;

final class FileExplorerFileHolder{
    private String _filename;
    private String _path;
    private String _dir;
    private boolean _isDir;
    
    
    FileExplorerFileHolder(String fileinfo){
        // Pull the information from the URI provided from the original FileConnection.
        int slash = fileinfo.lastIndexOf('/');
        
        if ( slash == -1 ) throw new IllegalArgumentException( "fileinfo must have a slash" );
        
        _path = fileinfo.substring(0, ++slash);
        _filename = fileinfo.substring(slash);
        _dir = _path+_filename;
    }

    public String getFileName(){ return _filename; }
    public String getPath() { return _path; }
    public String getDir() { return _dir; }
    public boolean isDirectory() { return _isDir; }
    public void setDirectory(boolean isDir) { _isDir = isDir; }
}

